package com.lyy.king.gateway.client;

import com.lyy.king.auth.api.AuthApi;
import com.lyy.king.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AuthClient {
    @Autowired
    private AuthApi authApi;


    /**
     * 检验token是否有效
     * @param token
     * @return
     */
    public Boolean checkToken(String token){
        try {
            Result<Boolean> result = authApi.checkToken(token);
            return result.getData();
        }catch (Exception e){
            // log
        }
        return false;
    }


}
